package com.yunyi.lam.pojo;

import lombok.*;

import java.util.List;

/**
 * 作者类
 *
 * @author yunyi
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class Author implements Comparable<Author> {
    /**
     * id
     */
    private Long id;
    /**
     * 姓名
     */
    private String name;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 简介
     */
    private String intro;
    /**
     * 书籍
     */
    private List<Book> books;

    @Override
    public int compareTo(Author o) {
        return this.getAge() - o.getAge();
    }
}
